import { Pipe, PipeTransform } from '@angular/core';
import { TitleCasePipe } from '@angular/common';

/**
 * Generated class for the UpperWordCasePipe pipe.
 *
 * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
 */
@Pipe({
  name: 'upperWordCase',
})
export class UpperWordCasePipe implements PipeTransform {
  /**
   * Takes a value and makes it lowercase.
   */
  constructor(
    public titleCase:TitleCasePipe
  ){

  }
  transform(value: string, ...args) {
    let wordArr = value.split('_');
    let changeArr = [];
    for(let i=0;i<wordArr.length;i++){
      changeArr.push(this.titleCase.transform(wordArr[i]));
    }
    return changeArr.join('');
  }
}
